<?php

/**
 * @Author:             wuchenge
 * @Date:               2025-03-12 13:51:19
 * @Last Modified by:   wuchenge
 */
namespace App\Models;

use App\Models\Model;

class PointRecord extends Model
{
    const POINT_INC = 1; // 增加
    const POINT_DEC = 2; // 减少
    /**
     * @var array
     */
    protected $fillable = ['user_id', 'points', 'type', 'from_user',
        'extends'];

    /**
     * @var array
     */
    protected $guarded = ['created_at', 'updated_at'];

    /**
     * @var string
     */
    protected $table = 'point_records';

    // 定义字段类型的转换
    /**
     * @var array
     */
    protected $casts = [
        // 将 'details' 字段转换为 JSON 格式
        'extends' => 'json',
    ];
}
